home *** CD-ROM | disk | FTP | other *** search
/ Apple Service Source 1993 May / Service Source (v1.8 May 1993).iso / AppleOrder / Program 2 / AppleOrder CCL Folder / XUSA Hardware_MNP.CCL next >
Encoding:
Text File  |  1992-09-08  |  20.3 KB  |  638 lines  |  [TEXT/MPS ]

  1. !
  2. ! USA modem CCL script using Hardware MNP protocol
  3. !
  4. !    Change History-
  5. !        v1.0        09/21/90    gs:General Release Version
  6. !        v1.0.2        12/07/90    gs:Added bug fix for Printer Port ~MPRT selection
  7. !        v1.0.2        01/30/91    gs:Changed \N3 to \N2 reliable only connection
  8. !        v2.0d1        12/3/91        gs:Supports ModemCmd and ConnectStr parameters
  9. !        v2.0        9/7/92        gs:General Release Version
  10. !
  11. !    The following label ranges (0-255) are defined for all scripts:
  12. !
  13. !    Label        Function
  14. !    -----        --------
  15. !    0-19        Communications Setup
  16. !    20-39        Get a Modem (IBX switch thru)
  17. !    40-59        Modem Setup
  18. !    60-79        Dialing
  19. !    80-99        Physical Connection
  20. !    100-119        GEIS Logon
  21. !    120-139        CICS
  22. !    140-159        APPM
  23. !    160-179        Online
  24. !    180-199        Terminate Session
  25. !    200-209        Cancel
  26. !    210-219        Hangup
  27. !    230-239        <UNUSED>
  28. !    240-255        Disconnect
  29. !
  30. !    Note:        Label 210 is the modem hangup sequence
  31. !                Label 240 is reserved as the start of the disconnect sequence
  32. !
  33. !================================================================================
  34. -LABEL 0    !***<Physical connection entry point>*** Initialize Communications
  35. !================================================================================
  36. !
  37. !    Set the Baud, Data, Stop, and Parity bits
  38. SerReset ~Baud ~Prty ~Xbts ~Sbts
  39. CTBParameter Port "~MPrt" 13
  40. !
  41. !    CTBOPEN [<LabelIfOpenFails>] [<LabelIfError>]
  42. CTBOpen 14 15        ! Open the Communications session
  43. !
  44. !    Flush any data, Initialize script variables and define Cancel label
  45. Flush                ! clear input buffer and ring buffer
  46. CanBtn 200            ! If user cancels, take the error return
  47. !
  48. SetVar 1 0            ! #of consecutive no responses to hangup command
  49. SetVar 2 0            ! #of consecutive no responses to modem configuration command
  50. SetVar 3 0            ! #of consecutive network contact failures.
  51. SetVar 4 0            ! #of logon validation failures
  52. SetVar 5 0            ! #of consecutive CICS90  failures
  53. SetVar 6 0            ! #of consecutive APPM failures
  54. SetVar 7 0            ! flag to indicate if connecting(0) or disconnecting(1)
  55. SetVar 8 0            ! not used
  56. !
  57. Jump 20                ! Go to Modem Selection and Setup
  58. !
  59. !*********
  60. -LABEL 13    !---<CTBParameter Port failed>---
  61. !*********
  62. Alert -1 CTBParameter Port caused an error.
  63. Exit -1                ! exit the script with an error.
  64. !
  65. !*********
  66. -LABEL 14    !---<CTBOpen failed>---
  67. !*********
  68. Alert -1 CTBOpen could not open communications.\13The serial port may already be in use.
  69. Exit -1                ! exit the script with an error.
  70. !
  71. !**********
  72. -LABEL 15    !---<CTBOpen err>---
  73. !**********
  74. Alert -1 CTBOpen caused an Communications Toolbox error.
  75. Exit -1                ! exit the script with an error.
  76. !
  77. !================================================================================
  78. -LABEL 20    !***<Modem Selection>*** Select modem through IBX switch
  79. !================================================================================
  80. !
  81. !================================================================================
  82. -LABEL 40    !***<Modem Setup>*** Modem Reset and Setup
  83. !================================================================================
  84. DsplyPic 1
  85. DsplyMsg Making sure the modem is ready.
  86. Jsr 210                ! Hang up (just in case)
  87. SetVar 1 0            ! clear # hangup tries counter
  88. !
  89. !**********
  90. -LABEL 42    ! ---<Got modem attention>---
  91. !**********
  92. DsplyMsg Setting modem parameters.
  93. !    Clear all previous MatchStr's and setup the modem
  94. MatchStr 1 42 Dummy
  95. Wait 30
  96. !    Send modem setup commands
  97. Xmit ~HCMD
  98. Wait 3
  99. Flush                ! clear input buffer
  100. Xmit \13
  101. !
  102. !    Look for one of the following expected responses
  103. MatchStr 1 60 OK
  104. Wait 180               ! wait 3 secs
  105. IncVar 2            ! increment # modem setup tries
  106. IfVar 2 3 44        ! if 3 tries, display Modem Configuration Alert
  107. DsplyMsg Modem does not respond to setup commands. Retrying ...
  108. Jump 42                ! else try modem setup again
  109. !
  110. !**********
  111. -LABEL 44    ! ---<Modem configuration err>---
  112. !**********
  113. Bell
  114. Alert 200 The modem is not responding to setup commands.\13Turn the modem off and then on again before retrying.
  115. SetVar 2 0            ! clear # modem setup tries
  116. Jump 40                ! reset modem and try again
  117. !
  118. !================================================================================
  119. -LABEL 60    !***<Modem ready>*** Dial phone
  120. !================================================================================
  121. DsplyMsg Dialing ~Fone ...
  122. DsplyPic 2
  123. !    Clear all previous MatchStr's (No comments on same line as MatchStr's)
  124. MatchStr 1 60 Dummy
  125. SetVar 2 0            ! clear #modem setup tries
  126. !    Turn off Xon/Xoff flow control
  127. CTBParameter Handshake XON/XOFF 78
  128. Wait 30                ! Give modem .5 secs to get ready before sending the attention chars
  129. Xmit AT
  130. Wait 3                ! Pause before "tone dial" command
  131. Xmit D~Tone
  132. Wait 3                ! Pause before phone number
  133. Xmit ~Fone
  134. Wait 3
  135. Flush                ! clear input buffer and send CR
  136. Xmit \13
  137. !
  138. !    Look for one of the following expected responses
  139. MatchStr 1 80 ~GSTR\13
  140. MatchStr 2 66 CARRIER
  141. MatchStr 3 70 BUSY
  142. MatchStr 4 74 NO DIAL
  143. MatchStr 5 62 ERROR
  144. Wait 2100            ! wait 35 secs
  145. !
  146. !**********
  147. -LABEL 62    !---<No response or ERROR from modem>---
  148. !**********
  149. IncVar 3            ! Increment # dial attempts counter
  150. IfVar 3 4 64        ! if 4 attempts, display No Dial Response Alert
  151. DsplyMsg Modem does not respond to Dial command. Retrying ...
  152. Jump 40                ! reset modem and try again
  153. !
  154. !**********
  155. -LABEL 64    !---<No dial response err>---
  156. !**********
  157. Bell
  158. Alert 200 The modem is not responding to dial command.\13Make sure your modem is connected to a phone line.
  159. SetVar 3 0            ! clear # dial attempts counter
  160. Jump 40                ! reset modem and try again
  161. !
  162. !**********
  163. -LABEL 66   !---<No Carrier>---
  164. !**********
  165. IncVar 3            ! Increment # dial attempts counter
  166. IfVar 3 4 68        ! if 4 attempts, display No Carrier Alert
  167. DsplyMsg No Carrier with phone number dialed. Retrying ...
  168. Jump 40                ! reset modem and try again
  169. !
  170. !**********
  171. -LABEL 68    !---<No carrier err>---
  172. !**********
  173. Bell
  174. Alert 200 Cannot detect carrier signal after dialing.\13Make sure the phone number provided is correct.
  175. SetVar 3 0            ! clear # dial attempts counter
  176. Jump 40                ! reset modem and try again
  177. !
  178. !**********
  179. -LABEL 70    !---<busy>---
  180. !**********
  181. IncVar 3            ! Increment # dial attempts counter
  182. IfVar 3 4 72        ! if 4 attempts, display Busy Alert
  183. DsplyMsg Phone number dialed is busy. Pause  before retrying.
  184. Wait 300            ! wait 5 secs
  185. DsplyMsg Phone number dialed is busy. Retrying ....
  186. Jump 40                ! reset modem and try again
  187. !
  188. !**********
  189. -LABEL 72    !---<Busy err>---
  190. !**********
  191. Bell
  192. Alert 200 All network access lines are in use.\13Try again later.
  193. SetVar 3 0            ! clear # dial attempts counter
  194. Jump 40                ! reset modem and try again
  195. !
  196. !**********
  197. -LABEL 74    !---<No Dialtone>---
  198. !**********
  199. IncVar 3            ! Increment # dial attempts counter
  200. IfVar 3 4 76        ! if 4 attempts, display No Dialtone Alert
  201. DsplyMsg Modem reports no dial tone. Retrying ...
  202. Jump 40                ! reset modem and try again
  203. !
  204. !**********
  205. -LABEL 76   !---<No dialtone Error>---
  206. !**********
  207. Bell
  208. Alert 200 Modem reports no dial tone.\13Make sure your modem is connected to a phone line.
  209. SetVar 3 0            ! clear # dial attempts counter
  210. Jump 40                ! reset modem and try again
  211. !
  212. !*********
  213. -LABEL 78    !---<CTBParameter XON/XOFF failed>---
  214. !*********
  215. Alert -1 CTBParameter XON/XOFF caused an error.
  216. Exit -1                ! exit the script with an error
  217. !
  218. !================================================================================
  219. -LABEL 80    !***<Establish Physical Connection>*** Send H's to identify us to network
  220. !================================================================================
  221. DsplyMsg Requesting network attention
  222. !    Look for one of the following expected responses
  223. MatchStr 1 84 NO CARRIER
  224. MatchStr 2 100 U#
  225. Wait 12                ! Wait 0.2 sec before sending the first H
  226. Xmit H
  227. Wait 21                ! Wait another 0.35 sec before sending the second H
  228. Xmit H
  229. Wait 600            ! Allow 10 seconds for the U# to show up
  230. IncVar 3            ! No U#, increment # dial attempts counter
  231. IfVar 3 4 82        ! if 4 attempts, display No U# Alert
  232. DsplyMsg Unable to get network attention. Retrying ...
  233. Jump 40                ! reset modem and try again
  234. !
  235. !**********
  236. -LABEL 82    !---<No U#>---
  237. !**********
  238. Bell
  239. Alert 200 Unable to get the network's attention.\13Make sure you have the correct phone number.
  240. SetVar 3 0            ! clear # dial attempts counter
  241. Jump 40                ! reset modem and try again
  242. !
  243. !**********
  244. -LABEL 84    !---<Line dropped>---
  245. !**********
  246. IncVar 3            ! Increment # dial attempts counter
  247. IfVar 3 4 86        ! if 4 attempts, display Line Dropped Alert
  248. DsplyMsg Carrier signal dropped before network recognition. Retrying ...
  249. Jump 40                ! reset modem and try again
  250. !
  251. !**********
  252. -LABEL 86   !---<Line dropped Err>---
  253. !**********
  254. Bell
  255. Alert 200 Carrier signal dropped before network recognition.\13Try again.
  256. SetVar 3 0            ! clear # dial attempts counter
  257. Jump 40                ! reset modem and try again
  258. !
  259. !================================================================================
  260. -LABEL 100    !***<GEIS logon>***
  261. !================================================================================
  262. !
  263. DsplyMsg Physical Connection established. Logging on to network ...
  264. DsplyPic 3
  265. SetVar 3 0            ! clear # dial attempts counter
  266. Wait 6                ! wait 0.1 sec
  267. Flush                ! clear input buffer
  268. !    Note: leave 2 spaces between ~Dist and ~Numb
  269. Xmit ~User,~Dist  ~Numb,~Ridn\13
  270. !
  271. !    Look for one of the following expected responses
  272. MatchStr 1 104 NO CARRIER
  273. MatchStr 2 106 DISCONNECTED
  274. MatchStr 3 120 ===>
  275. MatchStr 6 108 N FAULT,
  276. MatchStr 7 108 T FORMAT,
  277. MatchStr 8 110 L DENIED
  278. MatchStr 9 112 BUSY
  279. MatchStr 10 112 DOWN
  280. Wait 4200            ! wait up to 70 seconds for a response
  281. IncVar 4            ! Increment # logon attempts counter
  282. IfVar 4 3 102        ! if 3 tries, display No Login Response alert 
  283. DsplyMsg No logon response from network. Retrying ...
  284. Jump 40                ! reset modem and try again
  285. !
  286. !*********
  287. -LABEL 102    !---<No Logon response>---
  288. !*********
  289. Bell
  290. Alert 200 No logon response from network.\13Try again.
  291. SetVar 4 0            ! clear # logon attempts counter
  292. Jump 40                ! reset modem and try again
  293. !
  294. !*********
  295. -LABEL 104    !---<Carrier dropped>---
  296. !*********
  297. IncVar 4            ! Increment # login attempts counter
  298. IfVar 4 3 105        ! if 3 attempts, display Carrier dropped alert
  299. DsplyMsg Carrier signal dropped during network logon. Retrying ...
  300. Jump 40                ! reset modem and try again
  301. !
  302. !*********
  303. -LABEL 105    !---<Carrier dropped Err>---
  304. !*********
  305. Bell
  306. Alert 200 Carrier signal dropped during network logon.\13Try again.
  307. SetVar 4 0            ! clear # logon attempts counter
  308. Jump 40                ! reset modem and try again
  309. !
  310. !*********
  311. -LABEL 106    !---<Session disconnected>---
  312. !*********
  313. IncVar 4            ! Increment # logon attempts counter
  314. IfVar 4 3 107        ! if 3 attempts, display Session disconnected alert
  315. DsplyMsg Network connection dropped during network logon. Retrying ...
  316. Jump 40                ! reset modem and try again
  317. !
  318. !*********
  319. -LABEL 107    !---<Session disconnected Err>---
  320. !*********
  321. Bell
  322. Alert 200 Network connection dropped during network logon.\13Try again.
  323. SetVar 4 0            ! clear # logon attempts counter
  324. Jump 40                ! reset modem and try again
  325. !
  326. !*********
  327. -LABEL 108    !---<Validation fault>---
  328. !*********
  329. IncVar 4            ! Increment # logon attempts counter
  330. IfVar 4 3 109        ! see if limit of 3 is exceeded.
  331. DsplyMsg Network rejected your identification. Retrying ...
  332. Wait 60                ! wait 1 sec
  333. Jump 100            ! retry GEIS login (only case where we don't reset)
  334. !
  335. !*********
  336. -LABEL 109    !---<validation fault err>---
  337. !*********
  338. Bell
  339. Alert 200 Your network identification has been rejected.\13Check Setup to make sure your identification is correct.
  340. SetVar 4 0            ! clear # logon attempts counter
  341. Jump 40                ! reset modem and try again
  342. !
  343. !*********
  344. -LABEL 110    !---<Denied by host>---
  345. !*********
  346. IncVar 4            ! Increment # logon attempts counter
  347. IfVar 4 3 111        ! if 3 attempts, display Network Problem alert
  348. DsplyMsg Network host equipment problem detected. Retrying ...
  349. Jump 40                ! reset modem and try again
  350. !
  351. !*********
  352. -LABEL 111    !---<Denied by host err>---
  353. !*********
  354. Bell
  355. Alert 200 Network host equipment problem detected.\13Try again.
  356. SetVar 4 0            ! clear # logon attempts counter
  357. Jump 40                ! reset modem and try again
  358. !
  359. !*********
  360. -LABEL 112    !---<MARK3K access busy/down>---
  361. !*********
  362. IncVar 4            ! Increment # logon attempts counter
  363. IfVar 4 3 113        ! if 3 attempts, display Network Busy alert
  364. DsplyMsg Network equipment busy/down. Retrying ...
  365. Jump 40                ! reset modem and try again
  366. !
  367. !*********
  368. -LABEL 113    !---<MARK3K access busy/down err>---
  369. !*********
  370. Bell
  371. Alert 200 Network equipment busy or down.\13Try again.
  372. SetVar 4 0            ! clear # logon attempts counter
  373. Jump 40                ! reset modem and try again
  374. !
  375. !================================================================================
  376. -LABEL 120    !***<MARK3000 prompt>*** Invoke CICS
  377. !================================================================================
  378. !
  379. DsplyMsg Requesting access to network subsystem ...
  380. DsplyPic 4
  381. Wait 6                ! wait 0.1 secs
  382. Flush                ! clear input buffer
  383. !
  384. Xmit ~CICS\13
  385. !    Look for one of the following expected responses
  386. MatchStr 3 140 READY
  387. !    To overcome a network problem, the following label was changed from 124 to 126
  388. !    MatchStr 4 124 T BOUND
  389. MatchStr 4 126 T BOUND
  390. MatchStr 5 126 UNRECOGN
  391. MatchStr 6 126 ===>
  392. Wait 3600            ! Allow 60 secs for the expected responses to show up
  393. IncVar 5            ! Timeout, so increment # CICS tries counter
  394. IfVar 5 2 122        ! if 3 tries, display No Response alert
  395. DsplyMsg No response to network subsystem request. Retrying ...
  396. Jump 40                ! reset modem and try again
  397. !
  398. !*********
  399. -LABEL 122    !---<No CICS err>---
  400. !*********
  401. Bell
  402. Alert 200 No response to network subsystem request.\13Try again.
  403. SetVar 5 0            ! clear # CICS tries counter
  404. Jump 40                ! reset modem and try again
  405. !
  406. !*********
  407. -LABEL 124    !---<Session not bound err>---
  408. !*********
  409. Bell
  410. Alert 200 Network CICS subsystem needs to be started.\13Please contact the Apple USA helpline immediately.
  411. Jump 200            ! jump to cancel routine
  412. !
  413. !*********
  414. -LABEL 126    !---<Invalid application>---
  415. !*********
  416. IncVar 5            ! Increment # CICS tries counter
  417. IfVar 5 3 127        ! if 3 tries, display Invalid Application alert
  418. DsplyMsg Network subsystem request has been rejected. Retrying ...
  419. Wait 60                ! wait 1 sec
  420. Flush
  421. Jump 120            ! try to access CICS again
  422. !
  423. !*********
  424. -LABEL 127    !---<Invalid application err>---
  425. !*********
  426. Bell
  427. Alert 200 The network subsystem request has been rejected.\13Try again.
  428. SetVar 5 0            ! clear # CICS tries counter
  429. Flush
  430. Jump 40                ! reset modem and try again
  431. !
  432. !================================================================================
  433. -LABEL 140    !***<CICS ready>*** Start APPM transaction
  434. !================================================================================
  435. !
  436. DsplyMsg Requesting access to distribution center ~Dist ...
  437. DsplyPic 5            ! Highlight box 5 on screen
  438. SetVar 5 0            ! clear # CICS tries counter
  439. !                    ! Send what needs to be sent
  440. Xmit ~Epgm~Dist\13
  441. !    Look for one of the following expected responses
  442. Wait 12                ! wait 0.2 secs
  443. Flush                ! clear input buffer
  444. !    Look for one of the following expected responses
  445. MatchStr 3 160 C100
  446. MatchStr 4 144 INVALID
  447. Wait 3600            ! Allow 60 secs for the expected responses to show up
  448. !
  449. IncVar 6            ! Timeout, so Increment # APPM tries counter
  450. IfVar 6 2 142        ! if 2 tries, display No Transaction alert
  451. DsplyMsg No response to distribution center access request. Retrying ...
  452. Jump 40                ! reset modem and try again
  453. !
  454. !*********
  455. -LABEL 142    !---<No transaction response>---
  456. !*********
  457. Bell
  458. Alert 200 No response to distribution center access.\13Try again.
  459. SetVar 6 0            ! reset # APPM tries counter
  460. Jump 40                ! reset modem and try again
  461. !
  462. !*********
  463. -LABEL 144    !---<Invalid transaction>---
  464. !*********
  465. IncVar 6            ! Increment # APPM tries counter
  466. IfVar 6 2 145        ! if 2 tries, display Invalid Transaction alert
  467. DsplyMsg Distribution center access request rejected. Retrying ...
  468. Jump 40                ! reset modem and try again
  469. !
  470. !*********
  471. -LABEL 145    !---<Invalid transaction err>---
  472. !*********
  473. Bell
  474. Alert 200 Distribution center access request rejected.\13Check Setup to make sure your identification is correct.
  475. SetVar 6 0            ! reset # APPM tries counter
  476. Jump 40                ! reset modem and try again
  477. !
  478. !================================================================================
  479. -LABEL 160    !***<Online>***
  480. !================================================================================
  481. !
  482. Wait 60                ! wait 1 sec
  483. DsplyMsg Accessing the distribution center ~Dist ...
  484. DsplyPic 6            ! Highlight box 6 on screen
  485. !    C9 = pass msg thru GE, 899 = Echo cmd
  486. Xmit C9899Ole\13
  487. !    Look for one of the following expected responses
  488. MatchStr 2 162 C5
  489. MatchStr 3 170 Ole\13
  490. Wait 7200            ! wait 2 minutes for echo back or distribution center nonavail msg
  491. !
  492. !*********
  493. -LABEL 162    !---<no luck this time>--- 
  494. !*********
  495. DsplyMsg Distribution center is not available ...
  496. Jsr 180                ! terminate session
  497. Bell
  498. Alert -1 Distribution center is not available.\13Please try again later.
  499. Jump 200            ! exit to Cancel routine
  500. !
  501. !*********
  502. -LABEL 170    !---<Success, we’re in, so exit>--- 
  503. !*********
  504. Wait 30                ! wait 0.5 secs
  505. Flush                ! clear input buffer
  506. Exit 0                ! exit the script normally
  507. !
  508. !================================================================================
  509. -LABEL 180-199    !***<Terminate Session>***
  510. !================================================================================
  511. !
  512. !*********
  513. -LABEL 180    !---<Terminate session>--- 
  514. !*********
  515. !    send Abnormal disconnect command
  516. Xmit C3\13
  517. !    Look for one of the following expected responses
  518. MatchStr 1 182 U#
  519. Wait 300            ! wait 5 secs
  520. Return
  521. !
  522. !*********
  523. -LABEL 182    !---<Say bye>---
  524. !*********
  525. Wait 6                ! wait 0.1 sec and sign off the network
  526. Xmit BYE\13
  527. Return
  528. !
  529. !================================================================================
  530. -LABEL 200    !***<Cancel Routine>***
  531. !================================================================================
  532. DsplyMsg Canceling ...
  533. Flush
  534. Wait 30                ! wait 0.5 secs
  535. Exit -1                ! exit the script with an error
  536. !
  537. !================================================================================
  538. -LABEL 210    !***<Hang up phone Routine>***
  539. !================================================================================
  540. !
  541. !    Look for one of the following expected responses
  542. MatchStr 1 222 CARRIER
  543. SetVar 1 0            ! clear # hangup tries counter
  544. SetVar 2 0            ! clear # modem config tries counter and reuse for MNPStatus checks
  545. !
  546. !*********
  547. -LABEL 220    !---<Hang up the phone subroutine>---
  548. !*********
  549. Wait 60                ! wait 1 sec (beginning guard time) and send +++ (escape)
  550. Xmit +
  551. Xmit +
  552. Xmit +
  553. Wait 60                ! wait 1 more sec (end guard time)
  554. Flush                ! clear input buffer and tell modem to hang up verbosely
  555. Xmit ATV1H\13
  556. !    Look for one of the following expected responses
  557. MatchStr 2 222 OK
  558. MatchStr 3 224 ERROR
  559. Wait 120            ! wait 2 secs
  560. Jump 224            ! test for error or no response            
  561. !
  562. !*********
  563. -LABEL 222    !---<Reset the modem>---
  564. !*********
  565. !
  566. IfVar 7 0 229        ! If NOT disconnecting, bypass the modem reset.
  567. !                      This aids in script debugging so we dont reset modem 1st time.
  568. Flush                ! Flush the buffer and send Hayes Reset Modem command
  569. Xmit ATZ\13
  570. !    Look for one of the following expected responses
  571. MatchStr 2 229 OK
  572. MatchStr 3 224 ERROR
  573. Wait 180            ! wait 3 secs
  574. !
  575. !*********
  576. -LABEL 224    !---<Error or just no response>---
  577. !*********
  578. IncVar 1            ! Increment # hangup tries counter
  579. IfVar 1 3 225        ! if 3 tries, display error alert and try again
  580. Jump 220            ! try to hangup again
  581. !
  582. !*********
  583. -LABEL 225    !---<Error>---
  584. !*********
  585. IfVar 7 1 229        ! If disconnecting, just return.
  586. Alert 200 The modem is not responding to the hangup command.\13Turn it off and then on again before retrying.
  587. SetVar 1 0            ! clear # hangup tries counter
  588. Jump 220            ! try to hangup again
  589. !
  590. !*********
  591. -LABEL 229    !---<Return from the Hangup sequence>---
  592. !*********
  593. Wait 60                ! wait 1 sec
  594. Flush                ! clear input buffer
  595. Return
  596. !
  597. !================================================================================
  598. -LABEL 230-239    !***<UNUSED>***
  599. !================================================================================
  600. !
  601. !================================================================================
  602. -LABEL 240    !***<Disconnection Sequence>***
  603. !================================================================================
  604. !
  605. !    If the connection is closed, we cant hangup, so just exit
  606. !    CTBIFCLOSED <LabelToGotoIfConnectionClosed>
  607. CTBIFCLOSED 246
  608. !
  609. SetVar 7 1            ! We're disconnecting, so set the flag
  610. !    Look for one of the following expected responses
  611. MatchStr 1 242 U#
  612. MatchStr 2 244 NO CARRIER
  613. Wait 60                ! wait 1 sec
  614. Jump 244            ! and hang up the phone
  615. !
  616. !*********
  617. -LABEL 242    !---<Sign off the network>---
  618. !*********
  619. Xmit BYE\13
  620. Wait 120            ! wait 2 secs
  621. !
  622. !*********
  623. -LABEL 244    !---<Hang up the phone>---
  624. !*********
  625. SetVar 1 0            ! clear the # hangup tries counter
  626. Jsr 210                ! Execute the Hang-up subroutine
  627. !    No CTBClose here because the connection is closed externally from the script
  628. !    in case we exited the script with an error before completion.
  629. Flush                ! clear input buffer
  630. Exit 0                ! exit the script normally
  631. !
  632. !*********
  633. -LABEL 246    !---<Connection Was Closed>---
  634. !*********
  635. Flush                ! clear input buffer
  636. Exit 0                ! exit the script normally
  637. ###
  638.